<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title><?=($this->lang->line('lmg_home_title')=='')? 'unknown' : $this->lang->line('lmg_home_title');?></title>
	<meta http-equiv="content-type" content="text/html;charset=utf-8" />
	<meta name="generator" content="<?=""?>" />
	
	<link href="<?=base_url().$this->config->item('css_guest_template_url');?>" rel="stylesheet" type="text/css" />
	<link href="<?=base_url().$this->config->item('css_fancy_plugin_url');?>" rel="stylesheet" type="text/css" />
	<link href="<?=base_url().$this->config->item('css_autocomplete_url');?>" rel="stylesheet" type="text/css" />
	
	<script src="<?=$this->config->item('jq_google');?>" type="text/javascript" charset="utf_8"></script>
	<script src="<?=base_url().$this->config->item('jq_autocomplete_url');?>" type="text/javascript" charset="utf-8"></script>
	<script src="<?=base_url().$this->config->item('jq_slide_images_url');?>" type="text/javascript" charset="utf-8"></script>
	<script src="<?=base_url().$this->config->item('jq_mouse_wheel_plugin_url');?>" type="text/javascript" charset="utf_8"></script>
	<script src="<?=base_url().$this->config->item('jq_fancy_plugin_url');?>" type="text/javascript" charset="utf_8"></script>
	<script src="<?=base_url().$this->config->item('jq_flowplayer_plugin_url');?>" type="text/javascript" charset="utf_8"></script>
	
	
	<script type="text/javascript" charset="utf-8">
	
			$(function(){
				
				var url_contact_us =  "<?=site_url(); ?>index.php";
				
				// JQuery li list
				$('.menu >li').each(function(index){									
					
					// Add event to each a element in li item
					$('>a', this).click(function(event){
						
						// Prevent link to default url
						event.preventDefault();
						
						// Active this anchor is selected and disable others 
						$(this)
							.parents('.menu') // Get menu parent
								.find('a') // Find anchor child 
								   .removeClass('active') // Remove all name 's class is active
								.end() // Back to menu parent
							.end() // Back to current anchor
							.addClass('active'); // Add name's class is active
						
						// Get href attribute 's anchor
						var local_url = $(this).attr('href');
						
						//console.log(url_contact_us+'/'+local_url);
						

						$('.right').load(url_contact_us+'/'+local_url, function(){
						// load content success, do this 
						
							
						});						

						
					});

				});
				
				// Add function submit to form to process 
				$('#search_form').submit(function(){
		
					// Get href attribute 's anchor
					var local_url = $(this).attr('action');
					
					// Get search query from input
					var search_string = $('.search_text').val();					
					
					//console.log(search_string);
		
					//console.log (url_contact_us+'/'+local_url);
					
					var url = url_contact_us+'/'+local_url;
					
					$.post(
						url, // send data from this url
						{query : search_string}, // with data
						function(data){
							$('.right').html(data);
						},
						'html'
					);
					
					return false;
				});
							 				
				// Add event to text search 
				//$('.search_text').autocomplete(datas);
				
				// THIS IS NEW CODE FOR THE AUTOMATIC INFINITE CAROUSEL
				var autoscrolling = true;
				
				//	 Add Silde Images
				$('.slide').GoSlideImageBasic().mouseover(function () {
					autoscrolling = false;
				}).mouseout(function () {
					autoscrolling = true;
				});
				
				// Add OnClick for product_slide_right button
				$('.product_slide_right').click(function(){					
					$('.product_slide_main').trigger('next');
				});
				
				$('.product_slide_left').click(function(){
					$('.product_slide_main').trigger('prev');
				});
				
				
				setInterval(function () {
					if (autoscrolling) {
						$('.slide').trigger('next');
					}
				}, 9000);
				
				var url =  "<?=site_url(); ?>index.php/home/refresh_pages";
				
				var time_refresh = 9000;
				
				var req_mode = '<?=ONLINE_REQ_MODE;?>';
				
				setInterval(function(){
					
					$.post(
						url,
						{ref_types : req_mode},
						function (data) {
							//alert('refresh data');
							
							if (data != null) 
							{
								$('.statistic .statistic_number.o').html(data);
							}
						}
					);	
												
				}, time_refresh);
								
			});
	</script>
</head>

<body>

	<div class="background2" id="background">
	
		<div class="wrapper">
			 
			 <!-- BEGIN HEADER COMPONENT-->
			 <div class="header">
				<?php 
					
					/* ********************
					 * INCLUDE HEADER COMPONENT
					 * ********************/
					$this->load->view('templates/guest/includes/header'); 
					
				?>	
				<div style="clear:both"></div>		
			</div>
			<!-- END HEADER COMPONENT-->			
			
			<!-- BEGIN CENTER COMPONENT-->
			<div class="center">
				
				<!-- BEGIN CENTER BANNER COMPONENT -->
				<div class="banner">
					<img src="<?=base_url().$this->config->item('img').$this->lang->line('lmg_home_img_name_banner');?>" width="960" height="223" />
				</div>
				<!-- END CENTER BANNER COMPONENT -->
				
				<!-- BEGIN CENTER MAIN COMPONENT -->			
				<div class="main">
				
					<!-- BEGIN MAIN TOP COMPONENT -->
					<div class="main_top">
		            	<?php 
						
						/* ********************
						 * INCLUDE MENU COMPONENT
						 * ********************/
						$this->load->view('templates/guest/includes/menu'); 
						
						?>
		            </div>
		            <!-- END MAIN TOP COMPONENT -->
		            
		            <!-- BEGIN MAIN MID COMPONENTS --->
		            <div class="main_mid">
			            
			            <!-- BEGIN CONTENT MID COMPONENTS -->
			            <div class="content" id="content">
							
							<!-- BEGIN CONTENT MID LEFT COMPONENTS -->
							<div class="left">
							
								<!-- BEGIN CONTENT MID LEFT SEARCH COMPONENTS -->
								<div class="search">
		                        	<?php 
									
									/* ********************
									 * INCLUDE SEARCH COMPONENT
									 * ********************/
									 
									 // Get state from config file
									 $state = $this->config->item('db_search_components');
									 
									 if ($state)
									 {
										$this->load->view('templates/guest/includes/search'); 
									 }
									
									?>
								</div>
								<!-- END CONTENT MID LEFT SEARCH COMPONENTS -->
								
								<!-- BEGIN CONTENT MID LEFT HOTLINE COMPONENTS -->
								<div class="hotline">
									<?php 
									
									/* ********************
									 * INCLUDE HOTLINE COMPONENT
									 * ********************/
									 
									 // Get state from config file
									$state = $this->config->item('db_hotline_components');
									
									if ($state)
									{
										$this->load->view('templates/guest/includes/hotline'); 
									} 
																		
									?>
								</div>
								<!-- END CONTENT MID LEFT HOTLINE COMPONENTS -->
								
								<!-- BEGIN CONTENT MID LEFT CLOSE CUSTOMER COMPONENTS -->
								<div class="close_customer">
		                        	<?php 
									
									/* ********************
									 * INCLUDE CLOSE CUSTOMER COMPONENT
									 * ********************/
									 // Get state from config file
									 $state = $this->config->item('db_close_customer_components');
									 
									 // Check if close_customer components is enable 
									if ($state)
									{
										$this->load->view('templates/guest/includes/close_customer'); 
									}
									
									?>
		                        </div>
								<!-- END CONTENT MID LEFT CLOSE CUSTOMER COMPONENTS -->
								
								<!-- BEGIN CONTENT MID LEFT STATISTIC COMPONENTS -->
								<div class="statistic">
		                        	<?php 
									
									/* ********************
									 * INCLUDE STATISTIC COMPONENT
									 * ********************/
									 
									 $state = $this->config->item('db_statistic_components');
									
									if ($state) 
									{
										$this->load->view('templates/guest/includes/statistic'); 
									} 
																		
									?>
		                        </div>
								<!-- END CONTENT MID LEFT STATISTIC COMPONENTS -->
							
							</div>						
							<!-- END CONTENT MID LEFT COMPONENTS -->
							
							<!-- BEGIN CONTENT MID RIGHT COMPONENTS (**** CHANGE CONTENT ****) -->
							<div class="right" id="content">
								<?php 
									/* ********************
									 * INCLUDE MAIN CONTENT COMPONENT
									 * ********************/
									$this->load->view($main_content); 
									
								?>
							</div>
							<!-- END CONTENT MID RIGHT COMPONENTS (**** ****)-->
							
							<div style="clear:both"></div>
							
			            </div>
			            <!-- END CONTENT MID COMPONENTS -->
			            
			            <!-- BEGIN SLIDE MID COMPONENTS -->
			            <div class="slide">
							<?php 
									
									/* ********************
									 * INCLUDE SLIDE COMPONENT
									 * ********************/
									$this->load->view('templates/guest/includes/slide'); 
									
							?>
			            </div>
			            <!-- END SLIDE MID COMPONENTS -->
			            
		            </div>
		            <!-- END MAIN MID COMPONENTS-->
		            
		            <!-- BEGIN MAIN BOT COMPONENTS -->
		            <div class="main_bot">
			            <?php 
									
									/* ********************
									 * INCLUDE BOTTOM COMPONENT
									 * ********************/
									$this->load->view('templates/guest/includes/bottom'); 
									
							?>
		            </div>
		            <!-- END MAIN BOT COMPONENTS-->
	            
				</div>
				<!-- END CENTER MAIN COMPONENT -->			
				
	            
			</div>
			 <!-- END CENTER COMPONENT-->
			 
		</div>
		
	</div>
	
</body>

</html>

